﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="list_xgxz.aspx.cs" Inherits="系统管理_list_xgxz" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>管理相关险种</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
            DataKeyNames="code" DataSourceID="SqlDataSource1" ForeColor="#333333">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:BoundField DataField="code" HeaderText="资金账户" ReadOnly="True" SortExpression="code" />
                <asp:BoundField DataField="info" HeaderText="描述信息" SortExpression="info" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <EmptyDataTemplate>
                无数据
            </EmptyDataTemplate>
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:insurance_dbConnectionString %>"
            SelectCommand="SELECT * FROM [资金账户表] WHERE ([code] = @code)">
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="x" Name="code" QueryStringField="code" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
   <fieldset>
   <legend>管理相关险种</legend>

        <asp:LinkButton ID="LinkButton1" runat="server" >增加险种</asp:LinkButton>
        <asp:LinkButton ID="LinkButton2" runat="server" PostBackUrl="~/系统管理/list_zjzh.aspx">返回资金账户列表</asp:LinkButton><br />
        <br />
        <asp:GridView ID="GridView2" runat="server" AllowSorting="True" AutoGenerateColumns="False"
            CellPadding="4" DataKeyNames="id" DataSourceID="SqlDataSource2" ForeColor="#333333">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
                    SortExpression="id" />
                <asp:TemplateField HeaderText="资金账户" SortExpression="code">
                    <EditItemTemplate>
                        &nbsp;
                        <asp:TextBox ID="TextBox2" runat="server" ReadOnly="True" Text='<%# Bind("code") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("code") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="name" HeaderText="险种名称" SortExpression="name" />
                <asp:TemplateField HeaderText="类型" SortExpression="type">
                    <EditItemTemplate>
                        <asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal"
                            SelectedValue='<%# Bind("type") %>'>
                            <asp:ListItem Value="1">按比例算</asp:ListItem>
                            <asp:ListItem Value="2">按时间算</asp:ListItem>
                        </asp:RadioButtonList>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("type") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="缴费比例" SortExpression="BiLi">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("BiLi") %>'></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"
                            Display="Dynamic" ErrorMessage="不能为空"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1"
                            Display="Dynamic" ErrorMessage="只能为数字" ValidationExpression="^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$"></asp:RegularExpressionValidator>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("BiLi", "{0:P}") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="info" HeaderText="描述信息" SortExpression="info" />
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:insurance_dbConnectionString %>"
            DeleteCommand="DELETE FROM [险种表] WHERE [id] = @id" InsertCommand="INSERT INTO [险种表] ([code], [name], [type], [BiLi], [info]) VALUES (@code, @name, @type, @BiLi, @info)"
            SelectCommand="SELECT * FROM [险种表] WHERE ([code] = @code) ORDER BY [code]" UpdateCommand="UPDATE [险种表] SET [code] = @code, [name] = @name, [type] = @type, [BiLi] = @BiLi, [info] = @info WHERE [id] = @id">
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="x" Name="code" QueryStringField="code" Type="String" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="code" Type="String" />
                <asp:Parameter Name="name" Type="String" />
                <asp:Parameter Name="type" Type="Int32" />
                <asp:Parameter Name="BiLi" Type="Double" />
                <asp:Parameter Name="info" Type="String" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="code" Type="String" />
                <asp:Parameter Name="name" Type="String" />
                <asp:Parameter Name="type" Type="Int32" />
                <asp:Parameter Name="BiLi" Type="Double" />
                <asp:Parameter Name="info" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
       </fieldset>
    </div>
    </form>
</body>
</html>
